import {
	request,
	hotelRequest,
	otherRequest
} from '@/sheep/request';

export default {
  //轮询
  get_pre_order_status: (params) =>
    request({
      url: '/leshua/api/ls_pay/get_pre_order_status',
      method: 'GET',
      params,
    }),

  create_ls: (data) =>
    request({
      url: '/shop/api/lashin/create_ls',
      method: 'POST',
      data,
    }),

	// 支付记录
	pay_history: (data) =>
		request({
			url: '/shop/yb/user/bill',
			method: 'POST',
			data,
		}),
	// 购买后开奖
	buyOpen: (data) =>
		request({
			url: '/shop/api/lottery/pool/buyOpen',
			method: 'POST',
			data,
		}),
	// 商家收款 创建支付订单
	create_order: (data) =>
		request({
			url: '/shop/api/lashin/create',
			method: 'POST',
			data,
		}),
	// 购买优惠券
	couponPrepay: (data) =>
		otherRequest({
			url: '/shop/api/pay/couponPrepay',
			method: 'POST',
			data,
		}),
	// 商家收款 预支付
	shop_pay: (data) =>
		request({
			url: '/shop/api/pay/prepay',
			method: 'POST',
			data,
		}),
	prepay: (data) =>
		request({
			url: 'pay/prepay',
			method: 'POST',
			data,
			custom: {
				loadingMsg: '支付中',
			},
		}),
	// 发起提现
	withdraw: {
		// 用于轮询  不显示加载弹框
		updateList: (params) =>
			request({
				url: 'withdraw',
				method: 'GET',
				params,
				custom: {
					auth: true,
					showLoading: false,
				},
			}),
		list: (params) =>
			request({
				url: 'withdraw',
				method: 'GET',
				params,
				custom: {
					auth: true,
				},
			}),
		rules: () =>
			request({
				url: 'withdraw/rules',
				method: 'GET',
				custom: {
					auth: true,
				},
			}),
		apply: (data) =>
			request({
				url: 'withdraw/apply',
				method: 'POST',
				data,
				custom: {
					loadingMsg: '申请中',
					auth: true,
				},
			}),
		// 创建订单
		hotelcreate: (data) =>
			request({
				url: 'hotel/order/create',
				method: 'POST',
				data,
			}),
		// 支付
		payment: (data) =>
			request({
				url: 'pay/prepay',
				method: 'POST',
				data,
			}),
	},
	// 店铺金额数据
	getStoreMoney: () =>
		request({
			url: 'user/store/getMyStoreMoney',
			method: 'GET',
			custom: {
				showLoading: false,
				auth: true
			}
		}),
	getJxMoney: (data) =>
		request({
			url: '/shop/yb/user/getBillData',
			method: 'POST',
			data,
			custom: {
				showLoading: false,
				auth: true
			}
		}),	
	getStoreList: (data) =>
		request({
			url: 'user/store/getStoreOrder',
			method: 'POST',
			data,
			custom: {
				showLoading: false,
				auth: true
			}
		}),
	getStoreRate: () =>
		request({
			url: 'user/store/getStoreMoneyRate',
			method: 'GET',
			custom: {
				showLoading: false,
				auth: true
			}
		}),
	withdraw2: (data) =>
		request({
			url: 'user/store/withdrawalStoreMoney',
			method: 'POST',
			data,
			custom: {
				showLoading: false,
				auth: true
			}
		}),
	checkShop: () =>
		request({
			url: '/shop/yb/checkShop',
			method: 'GET',
			custom: {
				showLoading: false,
				auth: true
			}
		}),
		//获取严选店铺收益
		getSurpriseShop: () =>
		request({
			url: '/shop/api/goods/goods/getSelectedStoreMoney',
			method: 'GET',
			custom: {
				showLoading: false,
				auth: true
			}
		}), 
		// 获取严选商品分佣订单’
		getSurpriseShopOrder: (data) =>
		request({
			url: '/shop/api/goods/goods/getSelectedMoneyList',
			method: 'POST',
			data,
			custom: {
				showLoading: false,
				auth: true
			}
		}),
		//严选店铺提现
		getSurpriseShopWithdraw: (data) =>
		request({
			url: '/shop/api/goods/goods/withdrawalSelectedMoney',
			method: 'POST',
			data,
			custom: {
				showLoading: false,
				auth: true
			}
		}),

};